import { notFound } from "next/navigation"; import type { ReactNode } from "react"; import { getMetro } from "./data"; /** * Existence gate for /datacenters/markets/[slug]: resolves the metro before this segment's loading boundary * streams, so an unknown slug is a real 404 (not a soft one). Other API failures fall through to the page. */ export default async function MarketLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) { const { slug } = await params; const r = await getMetro(slug); if (!r.ok && r.status === 404) notFound(); return <>{children}; }